Prior art compactors such as described in U.S. Pat. No. 4,235,165 have had problems in that the user would be able to insert trash into the door opening when the container was not in position. This resulted in trash accumulating underneath the compactor and required the operator to pick up the trash lying on the ground. Further, the earlier developments did not provide for means which would deactivate the motor mechanism for driving the ram during certain periods such as when the door was opened, or when the container was not positioned. Additionally, the operator would not be able to know when he was overfilling the container. The ram would continue cramming more material into the container resulting in refuse heaping above the top of the container causing serious spillage when a container was withdrawn.